<?php
require('lib/verify.php');
require('lib/has_char.php');
require('lib/is_approved.php');

$instance_id = $_GET["id"];

$sql = "select * from wm_instances where instance_id='" . $instance_id . "'";
$result = $db->query($sql);
$instance = $db->fetch_assoc($result);

$_category = "warmath";
$_title = $instance["instance_name"] . " / " . $boss["boss_name"];
require('lib/head.php');


if($_GET["error"]!="") {
  boxRed("Error");
?>
    <?=$_GET["error"]?>
<?php
    boxBot();
    }

$sql = "select * from wm_bosses where boss_instance = $instance_id";
$result_b = $db->query($sql);
while($boss = $db->fetch_assoc($result_b)) {
?>
<a name="boss<?=$boss["boss_id"]?>"></a>
<?php
boxTop("Warmath: <a href=\"loot-instance.php?id=" . $instance["instance_id"] . "\">" . $instance["instance_name"] ."</a> / " . $boss["boss_name"]);
?>
Browse loot to mark items as max or min.<br /><br />
<i>Mark items as max or mod; or unmark an item by selecting non.</i><br />
<?php
				    $boss_id = $boss["boss_id"];
//@@todo: wishlist correspondance so we should folks what they have
$sql = "select * from wm_items left join item_cache on wm_items.item_id = item_cache.item_id where item_boss = '$boss_id' order by item_name asc";
$result = $db->query($sql);
while($item = $db->fetch_assoc($result)) {
  show_item($item, $character, $db, "loot-instance-all.php?id=" . $instance_id . "#boss" . $boss["boss_id"], $system);
}
?>

<?php
boxBot();
}
?>

<?php
require('lib/foot.php');
?>

